home *** CD-ROM | disk | FTP | other *** search
- Toproto v1.09 Copyright 1993 Charles E. Campbell, Jr
- ----------------------------------------------------------
-
- Copyright:
-
- This program (flist) and associated documents are copyrighted 1993
- by Charles E. Campbell, Jr, PhD.
-
-
- Restrictions:
-
- All rights to flist and its documents are reserved, except for those
- explicitly granted herein.
-
- No representation or warranties are made with respect to the accuracy,
- reliability, performance, or operation of this software, and all such
- use is at your own risk. The author does not assume any responsiblity
- or liability whatsoever with respect to your use of this software.
-
- Toproto may not be included with any commercial product nor may it be
- sold for profit either separately or as part of a compilation without
- the permission of Dr. Charles E. Campbell, Jr. It may be included in
- non-profit disk collections such as the Fred Fish collection. It may
- be archived and uploaded to electronic bulletin board systems so long
- as all files remain together and unaltered. It may be copied to and
- used on individuals' computer systems.
-
-
- Author : Dr. Charles E. Campbell, Jr.
- Contact: cec@gryphon.gsfc.nasa.gov
- Version: 1.09
-
-
- Usage:
-
- toproto [options] [filename1 [filename2 [filename3...]]
- toproto "?"
-
-
- Options:
-
- -b : body of code not printed
- -B : print both prototype and old style
- -Bstring : print both prototype and old style,
- using "string" instead of default __STDC__ in #ifdef test.
- -c : add variable list comments
- -o : make old-style declarations (ie. not prototypes)
- -r : replace file(s) with their new format (dangerous - use at own risk)
- -t type: use next argument as default type
- -v : report on progress (verbose)
-
-
- Explanation:
-
- toproto converts C files to a prototype-using format or to old K&R
- style. The toproto program will leave the old files with a .bak
- extension when the "-r" option is used. This program is
-
- *** !!! USE-AT-YOUR-OWN-RISK !!! ***
-
- It has the potential to destroy your files. Make sure that the output is
- compilable before deleting the *.bak file(s)! In particular, funky things done
- with the preprocessor may not be understood properly and can cause deleterious
- behavior.
-
- The
-
- toproto "?"
-
- will give you online help.
-
- Normally, toproto will send its output to the stdout (screen). Of course,
- that means that you can redirect it, filter it, etc. The -r option does
- allow one to replace files with the prototype'd (or K&R'd) form, but
- *PLEASE* be wary of it! Again: *I am not responsible or liable for any damage
- done by this program*.
-
- Now that I've said that, I've found toproto highly useful. It never damages
- *my* source code files, although I've seen it foul up some source issued
- by others (typically, because of funky things done with the preprocessor).
-
- Those of you who #define BEGIN { and #define END } will find that toproto
- does not work for you. In fact, any of you who don't use { and } properly
- will find toproto does not work for you.
-
- It will change <varargs.h> style to <stdarg.h> style (and vice versa):
-
- <varargs.h> style: <stdarg.h> style:
- --------------------------- ------------------------
-
- int yourfunc(arg1,va_alist) int yourfunc(sometype arg1,...)
- sometype arg1;
- va_dcl
- { {
- va_list args; va_list args;
- ... ...
- va_start(args); va_start(arg1,args);
- ... ...
- va_end(args); va_end(args);
-
-
- The -B flag causes toproto to issue both the new and old style:
-
- int main(int argc,char **argv)
- {
- }
-
- becomes
-
- #ifdef __STDC__
- int main(
- int argc,
- char **argv)
- #else /* __STDC__ */
- int main(argc,argv)
- int argc;
- char **argv;
- #endif /* __STDC__ */
- {
- }
-
- If -Bstring is used, the given string will be used instead of __STDC__.
-
- Normally, functions without types are assumed to be of type "int". The
- "-t type" flag allows one to change that default behavior (for example,
- one may wish to use -t void).
-
- The <rdcolor.dat> file should be moved to the s: directory. Set the
- environment variable
-
- setenv ChipData s:
-
- so that the programs can find it. The file provides a mapping from color
- names to escape sequences, and it should be fairly obvious as to how to
- modify it to suit your requirements.
-
- The hdrtag program was compiled with Aztec C on an A3000 with the following
- options: CCOPTS=-qf -wp -c2 -f8.
-
- Good luck, and let me know of any problems you encounter, and any attaboys
- will be appreciated :).
-